/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.me.entityBeans;

import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author Administrador
 */
@Entity
@Table(name = "T_TIPOS_PARIENTES")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "TTiposParientes.findAll", query = "SELECT t FROM TTiposParientes t"),
    @NamedQuery(name = "TTiposParientes.findByNIdParientePk", query = "SELECT t FROM TTiposParientes t WHERE t.nIdParientePk = :nIdParientePk"),
    @NamedQuery(name = "TTiposParientes.findByVTipoPariente", query = "SELECT t FROM TTiposParientes t WHERE t.vTipoPariente = :vTipoPariente")})
public class TTiposParientes implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "N_ID_PARIENTE_PK")
    private Short nIdParientePk;
    @Column(name = "V_TIPO_PARIENTE")
    private String vTipoPariente;
    @OneToMany(mappedBy = "nIdTipoParienteCteFk")
    private Collection<TClientes> tClientesCollection;

    public TTiposParientes() {
    }

    public TTiposParientes(Short nIdParientePk) {
        this.nIdParientePk = nIdParientePk;
    }

    public Short getNIdParientePk() {
        return nIdParientePk;
    }

    public void setNIdParientePk(Short nIdParientePk) {
        this.nIdParientePk = nIdParientePk;
    }

    public String getVTipoPariente() {
        return vTipoPariente;
    }

    public void setVTipoPariente(String vTipoPariente) {
        this.vTipoPariente = vTipoPariente;
    }

    @XmlTransient
    public Collection<TClientes> getTClientesCollection() {
        return tClientesCollection;
    }

    public void setTClientesCollection(Collection<TClientes> tClientesCollection) {
        this.tClientesCollection = tClientesCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (nIdParientePk != null ? nIdParientePk.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof TTiposParientes)) {
            return false;
        }
        TTiposParientes other = (TTiposParientes) object;
        if ((this.nIdParientePk == null && other.nIdParientePk != null) || (this.nIdParientePk != null && !this.nIdParientePk.equals(other.nIdParientePk))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.me.entityBeans.TTiposParientes[ nIdParientePk=" + nIdParientePk + " ]";
    }
    
}
